--战术终结
local zhanshuzhongjie = fk.CreateSkill {
    name = "mcdh_zhanshuzhongjie",
    tags = {Skill.Limited}
}

local U = require "packages/utility/utility"
local lib = require "packages/mcdh/lib"

zhanshuzhongjie:addEffect('active',{
    card_num = 0,
    target_num = 1,
    can_use = function(self, player)
        return player:usedSkillTimes(self.name, Player.HistoryGame) == 0
    end,
    card_filter = Util.FalseFunc,
    target_filter = function(self,player, to_select, selected)
        return #selected == 0
    end,
    on_use = function(self, room, effect)
        local target = effect.tos[1]
        local player = effect.from
        for _, p in ipairs(room:getOtherPlayers(target)) do
            if p:inMyAttackRange(target) then
                local use = room:askForUseCard(p, "slash", "slash", "#zhanshuzhongjie-use:"..target.id, true, {bypass_times =true,exclusive_targets = {target.id} })
                if use then
                    use.extraUse = true
                    room:useCard(use)
                else
                    if not target:isNude() then
                        local card =room:askForCardsChosen(player, p, 2, 2, "he",self.name)
                        room:throwCard(card, self.name, p, player)
                    end
                end
            end
        end
    end,
})

Fk:loadTranslationTable {
    ["mcdh_zhanshuzhongjie"] = "战术终结",
    [":mcdh_zhanshuzhongjie"] = "限定技，出牌阶段，你可以选择一名角色，令所有攻击范围内包含其的角色各选择一项：1.对其使用一张【杀】；2.被你弃置两张牌（不足全弃，无则不弃）。",
    ["#zhanshuzhongjie-use"] = "战术终结: 对 %src 使用一张【杀】"
}

return zhanshuzhongjie